PROGRAMS	= simple_pipe pipe_sync pipe_ls_wc popen_read popen_write \
fifo_seqnum_server fifo_seqnum_client \
psem_create thread_incr_psem  \
pshm_create pshm_write pshm_read pshm_unlink \
pmsg_create pmsg_receive pmsg_send pmsg_unlink \
t_flock

CFLAGS=-pthread

.PHONY:         all clean

all:            $(PROGRAMS)

pshm_create:
	gcc ${CFLAGS} -o $@ pshm_create.c -lrt
pshm_write:
	gcc ${CFLAGS} -o $@ pshm_write.c -lrt
pshm_read:
	gcc ${CFLAGS} -o $@ pshm_read.c -lrt
pshm_unlink:
	gcc ${CFLAGS} -o $@ pshm_unlink.c -lrt

pmsg_create:
	gcc ${CFLAGS} -o $@ pmsg_create.c -lrt
pmsg_send:
	gcc ${CFLAGS} -o $@ pmsg_send.c -lrt
pmsg_receive:
	gcc ${CFLAGS} -o $@ pmsg_receive.c -lrt
pmsg_unlink:
	gcc ${CFLAGS} -o $@ pmsg_unlink.c -lrt

clean: 
	@rm -f *.o *.a $(PROGRAMS) a.out core 
